<?php
declare (strict_types=1);

namespace app\api\controller\customer;

use app\api\controller\Api;
use app\common\order\model\Order as ModelOrder;

class Order extends Api {
    
    public function getData()
    {
        $post = $this->request->post();
        if (empty($post['member_id'])) return error([], "参数错误");
        $result = [];

        $where = [];
        $where[] = ['member_id', '=', $post['member_id']];
        $model = new ModelOrder();
        $list = $model->where($where)->select();
        foreach($list as $row) {
            $row->append(['category', 'company', 'cooperation', 'user', 'store', 'hall', 'banquet_type', 'order_type_text', 'check_tag']);
        }

        $result['list'] = $list;

        return success($result);
    }
}